import datetime
import time
from dateutil.relativedelta import relativedelta
startStr = '20150901'
today=time.strftime('%Y%m%d',time.localtime(time.time()))
startDate = datetime.datetime.strptime(startStr, '%Y%m%d')
endDate=startDate + relativedelta(months=+1)
endStr= time.strftime('%Y%m%d',time.localtime(time.time()))
print endStr
